package db;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

public class Connector {
	private static String url = "jdbc:postgresql://localhost:5432/postgres";
	private static String usr = "postgres";
	private static String pwd = "qwe123";
	private static Connection conn = null;
	
	private static Connector instance = new Connector();

	public static Connector getInstance() { return instance; };
		
	public static Connection getConnection() throws ClassNotFoundException, SQLException {
		Class.forName("org.postgresql.Driver");
		conn = DriverManager.getConnection(url, usr, pwd);
		return conn;
	}
	
	public static void close() throws SQLException {
		conn.close();
	}
}
